' #VBIDEUtils#***************************************************
' * Programmer Name  :????
' * Web Site         :
' * http://gpinteractive.cjb.net
' * E-Mail           : ???
' * Date             : 5/10/2001
' * Time             : 12:58 AM
' **************************************************************
' * Comments         : Download a web page
' **********************************************************

Private Sub GetPage(sURL As String, sFile As String)
   ' 
   On Error GoTo ERROR_GetPage

   Dim b() As Byte
   
   ' *** Cancel any operations
   'Internet transfer control -- Inet1
   Inet1.Cancel
   
   ' *** Set protocol to HTTP
   Inet1.protocol = icHTTP
   
   ' *** Set the URL Property
   Inet1.URL = sURL
   
   ' *** Retrieve the HTML data into a byte array.
   b() = Inet1.OpenURL(, icByteArray)
   
   ' *** Create a tempory file for the page to reside
   Open sFile For Binary Access Write As #1
   Put #1, , b()
   Close #1

EXIT_GetPage:
   Exit Sub


ERROR_GetPage:
Select Case MsgBox("Error " & Err.Number & ": " & _
  Err.Description & " at line: " & Erl, _
  vbAbortRetryIgnore + vbCritical, "Error")

      Case vbAbort
         Screen.MousePointer = vbDefault
         Resume EXIT_GetPage:
      Case vbRetry
         Resume
      Case vbIgnore
         Resume Next
   End Select
   
   Resume EXIT_GetPage

End Sub


